import request from "@/utils/request"

/**http://192.168.20.109:3000/project/37/interface/api/546
 * 查询车辆列表
 * @params communityId  carNum  memberName  pageNum  pageSize
 * @returns
 */
const getCarsList = (data, params) => {
  return request({
    url: "/cars/list",
    method: "post",
    data: data,
    params: params
  })
}
/**http://192.168.20.109:3000/project/37/interface/api/553
 * 新增车辆信息
 * @params  carNum  communityId  carModel  carType  carColor  userId
 * @returns
 */
const addCars = (data) => {
  return request({
    url: "/cars/add",
    method: "post",
    data: data
  })
}
/**http://192.168.20.109:3000/project/37/interface/api/560
 * 编辑车辆信息
 * @params  carNum  id  carModel  carType  carColor  userId
 * @returns
 */
const updateCars = (data) => {
  return request({
    url: "/cars/update",
    method: "post",
    data: data
  })
}
/**http://192.168.20.109:3000/project/37/interface/api/567
 * 删除车辆
 * @params  id
 * @returns
 */
const deleteCars = (data) => {
  return request({
    url: "/cars/delete",
    method: "post",
    data: data
  })
}
/**http://192.168.20.109:3000/project/37/interface/api/728
 * 查询车辆详情
 * @params  id
 * @returns
 */
const carsDetail = (data) => {
  return request({
    url: "/cars/info",
    method: "post",
    data: data
  })
}
/**http://192.168.20.109:3000/project/37/interface/api/1400
 * 导入车辆信息
 * @params  id
 * @returns
 */
const carsImport = (data) => {
  return request({
    url: "/cars/import",
    method: "post",
    data: data
  })
}
/**http://192.168.20.109:3000/project/37/interface/api/1620
 * 房屋人员导入
 * @params unitId
 * @returns
 */
const importTemplateCars = (data) => {
  return request({
    url: "/cars/importTemplate",
    method: "post",
    responseType: 'blob',
    data: data
  })
}
export default {
  getCarsList,
  addCars,
  updateCars,
  deleteCars,
  carsDetail,
  carsImport,
  importTemplateCars
}